package org.ehe.erp.domain.product;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.ehe.common.mybatis.core.domain.BaseEntity2;
import org.hibernate.validator.constraints.Length;

/**
 * @author :zhangnn
 * @className :Material
 * @description: TODO
 * @date 2025-09-08 14:25:05
 */
@Data
@TableName("erp_material")
public class ErpMaterial extends BaseEntity2 {
    @TableId(type = IdType.AUTO)
    private Long id;

    @NotBlank(message = "材料编码不能为空")
    @Pattern(regexp = "^[0-9]{2}$", message = "材料编码必须为2位数字")
    private String materialCode;

    @NotBlank(message = "材料名称不能为空")
    @Length(max = 50, message = "材料名称长度不能超过50字符")
    private String materialName;

    private Integer sortOrder;

    @NotNull(message = "状态不能为空")
    private Integer status;

    @Length(max = 200, message = "备注长度不能超过200字符")
    private String remark;
}
